<?php

/**************************************************************
*  NUKEVIET 2.0									*
*  License: GNU/GPL											*
*  Copyright (c) 2007 by Nukeviet Group				*
*  Website: http://www.nukeviet.vn						*
*  Email: contact@nukeviet.vn								*
**************************************************************/

if (!defined('NV_ADMIN')) { die ("Access Denied"); }
$checkmodname = "About";
$adm_access = checkmodac("".$checkmodname."");
if ($adm_access == 1) {
	if (file_exists("language/".$checkmodname."_".$currentlang.".php")) {
		include_once("language/".$checkmodname."_".$currentlang.".php");
	}
	if (file_exists("../$datafold/config_".$checkmodname.".php")) {
		include_once("../$datafold/config_".$checkmodname.".php");
	}

#############################################################

function AboutMenu() {
	global $adminfile;
	OpenTable();
	echo"<div style=\"text-align: center;\"><b>"._ABOUT."</b><br><br>\n";
	echo "<a href=\"".$adminfile.".php?op=AboutList\"><b>"._ABOUTLIST."</b></a> | \n";
	echo "<a href=\"".$adminfile.".php?op=AboutAdd\"><b>"._ABOUTADD."</b></a></div>\n";
	CloseTable();
	echo "<br>\n";
}

function AboutL() {
	global $db,$prefix,$currentlang;
	$sql = "SELECT * FROM ".$prefix."_about WHERE alanguage='".$currentlang."' ORDER BY weight ASC";
	$result = $db->sql_query($sql);
	$abouts = array();
	while ($row = $db->sql_fetchrow($result)) {
		$abouts[intval($row['id'])] = array(
			'title' => stripslashes($row['title']),
			'hometext' => stripslashes($row['hometext']),
			'bodytext' => stripslashes($row['bodytext']),
			'img' => stripslashes($row['img']),
			'address' => stripslashes($row['address']),
			'aemail' => stripslashes($row['aemail']),
			'aphone' => stripslashes($row['aphone']),
			'afax' => stripslashes($row['afax']),
			'amobile' => stripslashes($row['amobile']),
			'aurl' => stripslashes($row['aurl']),
			'weight' => intval($row['weight']),
			'active' => intval($row['active'])
		);
	}
	return $abouts;
}

function AboutChangePos() {
	global $adminfile,$db,$prefix,$currentlang;
	$id = intval(isset($_POST['id']) ? $_POST['id'] : $_GET['id']);
	$swid = intval(isset($_POST['swid']) ? $_POST['swid'] : $_GET['swid']);
	$newpos = intval(isset($_POST['newpos']) ? $_POST['newpos'] : $_GET['newpos']);
	$oldpos = intval(isset($_POST['oldpos']) ? $_POST['oldpos'] : $_GET['oldpos']);
	if($id!=0 AND $swid!=0 AND $id!=$swid AND $newpos!=0 AND $oldpos!=0 AND $oldpos!=$newpos) {
		$db->sql_query("UPDATE ".$prefix."_about SET weight=".$newpos." WHERE id=".$id." AND alanguage='".$currentlang."'");
		$db->sql_query("UPDATE ".$prefix."_about SET weight=".$oldpos." WHERE id=".$swid." AND alanguage='".$currentlang."'");
	}
	Header("Location: ".$adminfile.".php?op=AboutList");
	exit();
}

function AboutChangeActive() {
	global $prefix, $db, $currentlang,$adminfile;
	$id = intval(isset($_POST['id']) ? $_POST['id'] : $_GET['id']);
	if($id) {
		$active = intval(isset($_POST['active']) ? $_POST['active'] : $_GET['active']);
		$active = ($active==1) ? 1 : 0;
		$db->sql_query("UPDATE ".$prefix."_about SET active=".$active." WHERE id=".$id." AND alanguage='".$currentlang."'");
	}
	Header("Location: ".$adminfile.".php?op=AboutList");
	exit();
}

function AboutFixWeight() {
	global $db,$prefix,$currentlang;
	$sql = "SELECT * FROM ".$prefix."_about WHERE alanguage='".$currentlang."' ORDER BY weight ASC";
	$result = $db->sql_query($sql);
	$weight=0;
	while ($row = $db->sql_fetchrow($result)) {
		$id = intval($row['id']);
		$weight++;
		$db->sql_query("UPDATE ".$prefix."_about SET weight=".$weight." WHERE id=".$id." AND alanguage='".$currentlang."'");
	}
}

function AboutList() {
	global $adminfile,$db,$prefix,$currentlang;
	$abouts = AboutL();
	if($abouts==array()) {
		Header("Location: ".$adminfile.".php?op=AboutAdd");
		exit();
	}
	include("../header.php");
	GraphicAdmin();
	AboutMenu();
	OpenTable();
	echo "<div style=\"text-align:center;\"><b>"._ABOUTLIST."</b></div><br>";
	echo "<table bgcolor=\"#FFFFFF\" border=\"0\" cellpadding=\"2\" style=\"border-collapse: collapse;\" width=\"100%\" cellspacing=\"2\">\n";
	echo "<tr>\n";
	echo "<td style=\"border: 1px solid #C0C0C0\" width=\"98%\"><b>"._TITLE."</b></td>\n";
	echo "<td align=\"center\" style=\"border: 1px solid #C0C0C0\"><b>"._POSITION."</b></td>\n";
	echo "<td align=\"center\" style=\"border: 1px solid #C0C0C0\"><b>"._STATUS."</b></td>\n";
	echo "</tr>\n";
	foreach($abouts as $id => $ab) {
		echo "<tr>\n";
		echo "<td style=\"border: 1px solid #C0C0C0\">&nbsp;".$ab['title']." [<a href=\"".$adminfile.".php?op=AboutEdit&amp;id=".$id."\">"._EDIT."</a> | \n";
		echo "<a href=\"".$adminfile.".php?op=AboutDel&amp;id=".$id."\">"._DELETE."</a>]</td>\n";
		echo "<td style=\"border: 1px solid #C0C0C0\"><select name=\"changepos\" onchange=\"top.location.href=this.options[this.selectedIndex].value\">\n";
		foreach($abouts as $id2 => $ab2) {
			echo "<option value=\"".$adminfile.".php?op=AboutChangePos&amp;id=".$id."&amp;swid=".$id2."&amp;oldpos=".$ab['weight']."&amp;newpos=".$ab2['weight']."\"";
			if($ab2['weight'] == $ab['weight']) {
				echo " selected=\"selected\"";
			}
			echo ">".$ab2['weight']."</option>\n";
		}
		echo "</select></td>\n";
		echo "<td style=\"border: 1px solid #C0C0C0\"><select name=\"changeactive\" onchange=\"top.location.href=this.options[this.selectedIndex].value\">\n";
		$ihomes = array(_DEACTIVATE,_ACTIVATE);
		for($i=0;$i < 2;$i++) {
			echo "<option value=\"".$adminfile.".php?op=AboutChangeActive&amp;id=".$id."&amp;active=".$i."\"";
			if($i == $ab['active']) {
				echo " selected=\"selected\"";
			}
			echo ">".$ihomes[$i]."</option>\n";
		}
		echo "</select></td>\n";
		echo "</tr>\n";
	}
	echo "</table><br><br>\n";
	CloseTable();
	include("../footer.php");
}

function AboutAdd() {
	//Dung cho Innovaditor
	//global $editor, $adminfile,$max_size,$currentlang,$db,$prefix;
	global $adminfile,$max_size,$currentlang,$db,$prefix;
	if(function_exists("set_time_limit") && @ini_get('safe_mode') == 'Off') {
		@set_time_limit(0);
	}
	@ini_set('memory_limit' , '40M');
	$title = stripslashes($_POST['title']);
	$hometext = stripslashes($_POST['hometext']);
	$bodytext = stripslashes($_POST['bodytext']);
	$address = stripslashes($_POST['address']);
	$aemail = stripslashes($_POST['aemail']);
	$aphone = stripslashes($_POST['aphone']);
	$afax = stripslashes($_POST['afax']);
	$amobile = stripslashes($_POST['amobile']);
	$aurl = stripslashes($_POST['aurl']);
	$save = intval($_POST['save']);
	$error = FALSE;
	if($save) {
		if($title=="") {
			$error = TRUE;
		} elseif($bodytext=="") {
			$error = TRUE;
		}
		if($error==FALSE) {
			$hometext = nl2brStrict($hometext);
			//Dung cho InnovaEditor
			/*if(!$editor) {
				$bodytext = nl2brStrict($bodytext);
			}*/
			$bodytext = nl2brStrict($bodytext);
			if (!eregi("http://",$aurl) AND $aurl != "") {
				$aurl = "http://".$aurl;
			}
			$imgname = "";
			if (is_uploaded_file($_FILES['userfile']['tmp_name'])) {
				$realname = $_FILES['userfile']['name'];
				$file_size = $_FILES['userfile']['size'];
				$file_type = $_FILES['userfile']['type'];
				$f_name = end(explode(".", $realname));
				$f_extension = strtolower($f_name);
				$loaiimg_ext = array("gif","jpg","jpeg","pjpeg","png");
				$loaiimg_mime = array("image/gif", "image/pjpeg", "image/jpeg", "image/png");
				if ($file_size <= $max_size) {
					 if(in_array($file_type,$loaiimg_mime) AND in_array($f_extension,$loaiimg_ext)) {
					 	$datakod = date('U');
						$iname = $datakod.".".$f_extension;
						if(! @copy($_FILES['userfile']['tmp_name'], INCLUDE_PATH."uploads/about/".$iname) ) {
							@move_uploaded_file($_FILES['userfile']['tmp_name'], INCLUDE_PATH."uploads/about/".$iname);
						}
						if (file_exists(INCLUDE_PATH."uploads/about/".$iname)) {
							$imgname = $iname;
						}
					}
				}
			}
			list($weight) = $db->sql_fetchrow($db->sql_query("SELECT MAX(weight) as xweight FROM ".$prefix."_about WHERE alanguage='".$currentlang."'"));
			$weight = intval($weight) + 1;
			$result = $db->sql_query("INSERT INTO ".$prefix."_about VALUES (
			NULL, '".$title."', '".$hometext."', '".$bodytext."', '".$imgname."', '".$address."', '".$aemail."', '".$aphone."', '".$afax."', '".$amobile."', '".$aurl."', ".$weight.", '".$currentlang."',1 
			)");
			Header("Location: ".$adminfile.".php?op=AboutList");
			exit();
		}
	}
	include("../header.php");
	GraphicAdmin();
	AboutMenu();
	OpenTable();
	echo "<div style=\"text-align:center;\"><b>"._ABOUTADD."</b></div><br>";
	echo "<form method=\"post\" action=\"".$adminfile.".php?op=AboutAdd\" enctype=\"multipart/form-data\">\n";
	echo "<table border=\"0\" cellpadding=\"2\" style=\"border-collapse: collapse\" width=\"100%\" cellspacing=\"2\">\n";
	echo "<tr>\n";
	echo "<td>"._TITLE.":</td>\n";
	echo "<td align=\"right\">\n";
	echo "<input type=\"text\" name=\"title\" size=\"20\" value=\"".$title."\" style=\"width: 500px\"></td>\n";
	echo "</tr>\n";
	echo "<tr>\n";
	echo "<td valign=\"top\">"._ABOUTHOMETEXT.":</td>\n";
	echo "<td align=\"right\">\n";
	//Dung cho Innovaditor
	//echo "<textarea rows=\"5\" name=\"hometext\" cols=\"20\" style=\"width: 500px\">".encodeHTML($hometext)."</textarea></td>\n";
	echo "<textarea rows=\"5\" name=\"hometext\" cols=\"20\" style=\"width: 500px\">".$hometext."</textarea></td>\n";
	echo "</tr>\n";
	echo "<tr>\n";
	echo "<td valign=\"top\">"._ABOUTBODYTEXT.":</td>\n";
	echo "<td align=\"right\">\n";
	//Dung cho Innovaditor
	/*echo "<textarea rows=\"10\" name=\"bodytext\" cols=\"20\" style=\"width: 500px\">".encodeHTML($bodytext)."</textarea>";
	if($editor==1) {
		echo aleditor("bodytext");
	}*/
	echo "<textarea rows=\"10\" name=\"bodytext\" cols=\"20\" style=\"width: 500px\">".$bodytext."</textarea>";
	echo "</td>\n";
	echo "</tr>\n";
	echo "<tr>\n";
	echo "<td>"._STPIC.":</td>\n";
	echo "<td align=\"right\"><input type=\"file\" name=\"userfile\" size=\"20\"></td>\n";
	echo "</tr>\n";
	echo "<tr>\n";
	echo "<td>"._NADDRESS.":</td>\n";
	echo "<td align=\"right\"><input type=\"text\" name=\"address\" style=\"width: 500px\" value=\"".$address."\"></td>\n";
	echo "</tr>\n";
	echo "<tr>\n";
	echo "<td>"._LT_EMAIL.":</td>\n";
	echo "<td align=\"right\"><input type=\"text\" name=\"aemail\" style=\"width: 500px\" value=\"".$aemail."\"></td>\n";
	echo "</tr>\n";
	echo "<tr>\n";
	echo "<td>"._TELEPHONE.":</td>\n";
	echo "<td align=\"right\"><input type=\"text\" name=\"aphone\" style=\"width: 500px\" value=\"".$aphone."\"></td>\n";
	echo "</tr>\n";
	echo "<tr>\n";
	echo "<td>"._NFAX.":</td>\n";
	echo "<td align=\"right\"><input type=\"text\" name=\"afax\" style=\"width: 500px\" value=\"".$afax."\"></td>\n";
	echo "</tr>\n";
	echo "<tr>\n";
	echo "<td>"._NMOBILE.":</td>\n";
	echo "<td align=\"right\"><input type=\"text\" name=\"amobile\" style=\"width: 500px\" value=\"".$amobile."\"></td>\n";
	echo "</tr>\n";
	echo "<tr>\n";
	echo "<td>"._URL.":</td>\n";
	echo "<td align=\"right\"><input type=\"text\" name=\"aurl\" style=\"width: 500px\" value=\"".$aurl."\"></td>\n";
	echo "</tr>\n";
	echo "<tr>\n";
	echo "<td colspan=\"2\" style=\"text-align: right\">\n";
	echo "<input type=\"hidden\" name=\"save\" value=\"1\">\n";
	echo "<input type=\"submit\" value=\""._SAVE."\"></td>\n";
	echo "</tr>\n";
	echo "</table>\n";
	echo "</form>\n";
	CloseTable();
	include("../footer.php");
}

function AboutEdit() {
	//Dung cho Innovaditor
	//global $editor, $adminfile,$max_size,$currentlang,$db,$prefix;
	global $adminfile,$max_size,$currentlang,$db,$prefix;
	if(function_exists("set_time_limit") && @ini_get('safe_mode') == 'Off') {
		@set_time_limit(0);
	}
	@ini_set('memory_limit' , '40M');
	$id = intval(isset($_POST['id']) ? $_POST['id'] : $_GET['id']);
	$sql = "SELECT * FROM ".$prefix."_about WHERE id='".$id."' AND alanguage='".$currentlang."'";
	$result = $db->sql_query($sql);
	if($db->sql_numrows($result)!=1) {
		Header("Location: ".$adminfile.".php?op=AboutList");
		exit();
	}
	$row = $db->sql_fetchrow($result);
	$save = intval($_POST['save']);
	$error = FALSE;
	if($save) {
		$title = stripslashes($_POST['title']);
		$hometext = stripslashes($_POST['hometext']);
		$bodytext = stripslashes($_POST['bodytext']);
		$address = stripslashes($_POST['address']);
		$aemail = stripslashes($_POST['aemail']);
		$aphone = stripslashes($_POST['aphone']);
		$afax = stripslashes($_POST['afax']);
		$amobile = stripslashes($_POST['amobile']);
		$aurl = stripslashes($_POST['aurl']);
		$img = stripslashes($_POST['img']);
		if($title=="") {
			$error = TRUE;
		} elseif($bodytext=="") {
			$error = TRUE;
		}
		if($error==FALSE) {
			$hometext = nl2brStrict($hometext);
			//Dung cho Innovaditor
			/*if(!$editor) {
				$bodytext = nl2brStrict($bodytext);
			}*/
			$bodytext = nl2brStrict($bodytext);
			
			if (!eregi("http://",$aurl) AND $aurl != "") {
				$aurl = "http://".$aurl;
			}
			$delpic = intval($_POST['delpic']);
			if($delpic AND $img!="") {
				@unlink(INCLUDE_PATH."uploads/about/".$img);
				$img = "";
			}
			
			if (is_uploaded_file($_FILES['userfile']['tmp_name'])) {
				$realname = $_FILES['userfile']['name'];
				$file_size = $_FILES['userfile']['size'];
				$file_type = $_FILES['userfile']['type'];
				$f_name = end(explode(".", $realname));
				$f_extension = strtolower($f_name);
				$loaiimg_ext = array("gif","jpg","jpeg","pjpeg","png");
				$loaiimg_mime = array("image/gif", "image/pjpeg", "image/jpeg", "image/png");
				if ($file_size <= $max_size) {
					 if(in_array($file_type,$loaiimg_mime) AND in_array($f_extension,$loaiimg_ext)) {
					 	$datakod = date('U');
						$iname = $datakod.".".$f_extension;
						if(! @copy($_FILES['userfile']['tmp_name'], INCLUDE_PATH."uploads/about/".$iname) ) {
							@move_uploaded_file($_FILES['userfile']['tmp_name'], INCLUDE_PATH."uploads/about/".$iname);
						}
						if (file_exists(INCLUDE_PATH."uploads/about/".$iname)) {
							if ($img!="") {
								@unlink(INCLUDE_PATH."uploads/about/".$img);
							}
							$img = $iname;
						}
					}
				}
			}
			$db->sql_query("UPDATE ".$prefix."_about SET 
			title='".$title."', hometext='".$hometext."', bodytext='".$bodytext."', img='".$img."', 
			address='".$address."', aemail='".$aemail."', aphone='".$aphone."', afax='".$afax."', 
			amobile='".$amobile."', aurl='".$aurl."' WHERE id=".$id." AND alanguage='".$currentlang."'");
			Header("Location: ".$adminfile.".php?op=AboutList");
			exit();
		}
	} else {
		$title = stripslashes($row['title']);
		$hometext = stripslashes($row['hometext']);
		$bodytext = stripslashes($row['bodytext']);
		$address = stripslashes($row['address']);
		$aemail = stripslashes($row['aemail']);
		$aphone = stripslashes($row['aphone']);
		$afax = stripslashes($row['afax']);
		$amobile = stripslashes($row['amobile']);
		$aurl = stripslashes($row['aurl']);
		$img = stripslashes($row['img']);
		
		$hometext = str_replace("<br />", "\r\n", $hometext);
		//Dung cho Innovaditor
		/*if(!$editor) {
			$bodytext = str_replace("<br />", "\r\n", $bodytext);
		}*/
		$bodytext = str_replace("<br />", "\r\n", $bodytext);
	}
	include("../header.php");
	GraphicAdmin();
	AboutMenu();
	OpenTable();
	echo "<div style=\"text-align:center;\"><b>"._ABOUTEDIT."</b></div><br>";
	echo "<form method=\"post\" action=\"".$adminfile.".php?op=AboutEdit\" enctype=\"multipart/form-data\">\n";
	echo "<table border=\"0\" cellpadding=\"2\" style=\"border-collapse: collapse\" width=\"100%\" cellspacing=\"2\">\n";
	echo "<tr>\n";
	echo "<td>"._TITLE.":</td>\n";
	echo "<td align=\"right\">\n";
	echo "<input type=\"text\" name=\"title\" size=\"20\" value=\"".$title."\" style=\"width: 500px\"></td>\n";
	echo "</tr>\n";
	echo "<tr>\n";
	echo "<td valign=\"top\">"._ABOUTHOMETEXT.":</td>\n";
	echo "<td align=\"right\">\n";
	//Dung cho Innovaditor
	//echo "<textarea rows=\"5\" name=\"hometext\" cols=\"20\" style=\"width: 500px\">".encodeHTML($hometext)."</textarea></td>\n";
	echo "<textarea rows=\"5\" name=\"hometext\" cols=\"20\" style=\"width: 500px\">".$hometext."</textarea></td>\n";
	echo "</tr>\n";
	echo "<tr>\n";
	echo "<td valign=\"top\">"._ABOUTBODYTEXT.":</td>\n";
	echo "<td align=\"right\">\n";
	//Dung cho Innovaditor
	/*echo "<textarea rows=\"10\" name=\"bodytext\" cols=\"20\" style=\"width: 500px\">".encodeHTML($bodytext)."</textarea>";
	if($editor==1) {
		echo aleditor("bodytext");
	}*/
	echo "<textarea rows=\"10\" name=\"bodytext\" cols=\"20\" style=\"width: 500px\">".$bodytext."</textarea>";
	echo "</td>\n";
	echo "</tr>\n";
	echo "<tr>\n";
	echo "<td>"._STPIC.":</td>\n";
	echo "<td align=\"right\">\n";
	if($img!="") {
		$imglink = 'uploads/about/'.$img;
		$size = @getimagesize(INCLUDE_PATH.$imglink);
		echo "<img border=\"0\" src=\"".INCLUDE_PATH."images/foto.gif\" width=\"16\" height=\"16\" alt=\""._VIEWIMAGE."\" style=\"cursor: pointer\" \n";
		echo "onclick=\"at_openwindow('".INCLUDE_PATH."viewimg.php?imglink=".$imglink."','viewclick',".$size[0].",".$size[1].",'directories=no,location=no,resizable=no,menubar=no,toolbar=no,scrollbars=no,status=no');\"> \n";
		echo "<input type=\"checkbox\" name=\"delpic\" value=\"1\"> \n";
	}
	echo "<input type=\"hidden\" name=\"img\" value=\"".$img."\">\n";
	echo "<input type=\"file\" name=\"userfile\" size=\"20\"></td>\n";
	echo "</tr>\n";
	echo "<tr>\n";
	echo "<td>"._NADDRESS.":</td>\n";
	echo "<td align=\"right\"><input type=\"text\" name=\"address\" style=\"width: 500px\" value=\"".$address."\"></td>\n";
	echo "</tr>\n";
	echo "<tr>\n";
	echo "<td>"._LT_EMAIL.":</td>\n";
	echo "<td align=\"right\"><input type=\"text\" name=\"aemail\" style=\"width: 500px\" value=\"".$aemail."\"></td>\n";
	echo "</tr>\n";
	echo "<tr>\n";
	echo "<td>"._TELEPHONE.":</td>\n";
	echo "<td align=\"right\"><input type=\"text\" name=\"aphone\" style=\"width: 500px\" value=\"".$aphone."\"></td>\n";
	echo "</tr>\n";
	echo "<tr>\n";
	echo "<td>"._NFAX.":</td>\n";
	echo "<td align=\"right\"><input type=\"text\" name=\"afax\" style=\"width: 500px\" value=\"".$afax."\"></td>\n";
	echo "</tr>\n";
	echo "<tr>\n";
	echo "<td>"._NMOBILE.":</td>\n";
	echo "<td align=\"right\"><input type=\"text\" name=\"amobile\" style=\"width: 500px\" value=\"".$amobile."\"></td>\n";
	echo "</tr>\n";
	echo "<tr>\n";
	echo "<td>"._URL.":</td>\n";
	echo "<td align=\"right\"><input type=\"text\" name=\"aurl\" style=\"width: 500px\" value=\"".$aurl."\"></td>\n";
	echo "</tr>\n";
	echo "<tr>\n";
	echo "<td colspan=\"2\" style=\"text-align: right\">\n";
	echo "<input type=\"hidden\" name=\"save\" value=\"1\">\n";
	echo "<input type=\"hidden\" name=\"id\" value=\"".$id."\">\n";
	echo "<input type=\"submit\" value=\""._SAVE."\"></td>\n";
	echo "</tr>\n";
	echo "</table>\n";
	echo "</form>\n";
	CloseTable();
	include("../footer.php");
}

function AboutDel() {
	global $adminfile, $db, $prefix, $currentlang;
	$id = intval(isset($_POST['id']) ? $_POST['id'] : $_GET['id']);
	$sql = "SELECT * FROM ".$prefix."_about WHERE id='".$id."' AND alanguage='".$currentlang."'";
	$result = $db->sql_query($sql);
	if($db->sql_numrows($result)!=1) {
		Header("Location: ".$adminfile.".php?op=AboutList");
		exit();
	}
	$row = $db->sql_fetchrow($result);
	$ok = intval(isset($_POST['ok']) ? $_POST['ok'] : $_GET['ok']);
	if($ok) {
		$img = stripslashes($row['img']);
		if($img!="") {
			@unlink(INCLUDE_PATH."uploads/about/".$img);
		}
		$db->sql_query("DELETE FROM ".$prefix."_about WHERE id='".$id."' AND alanguage='".$currentlang."'");
		AboutFixWeight();
		Header("Location: ".$adminfile.".php?op=AboutList");
		exit();
	} else {
		include("../header.php");
		GraphicAdmin();
		AboutMenu();
		OpenTable();
		echo "<div style=\"text-align:center;\"><b>".stripslashes($row['title'])."</b></div><br>";
		echo "<br><br><div align=\"center\">[ <a href=\"".$adminfile.".php?op=AboutDel&amp;ok=1&amp;id=".$id."\">"._DELETE."</a> ] | "._GOBACK."</div><br><br>\n";
		CloseTable();
		include("../footer.php");
	}
}

switch ($op) {
	case "AboutList": AboutList(); break;
	case "AboutAdd": AboutAdd(); break;
	case "AboutEdit": AboutEdit(); break;
	case "AboutDel": AboutDel(); break;
	case "AboutChangePos": AboutChangePos(); break;
	case "AboutChangeActive": AboutChangeActive(); break;
}

} else {
    include("../header.php");
    GraphicAdmin(); 
    OpenTable(); 
    echo "<center><b>"._ERROR."</b><br><br>"._NOTAUTHORIZED."</center>"; 
    CloseTable(); 
    include("../footer.php"); 
}

?>